// import com.alibaba.druid.sql.ast.SQLName_ptr;
// import com.alibaba.druid.sql.ast.SQLObjectImpl;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

// import java.util.ArrayList;
// import java.util.List;

#include "SQLAlterTableReplaceColumn.h"
#include "SQLColumnDefinition.h"
#include "../../visitor/SQLASTVisitor.h"
#include "../../../utils/listTran.h"

SQLAlterTableReplaceColumn::SQLAlterTableReplaceColumn()
{
  columns = std::make_shared<std::list<SQLColumnDefinition_ptr>>();
}
// @Override
void SQLAlterTableReplaceColumn::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLAlterTableReplaceColumn)))
  {
    SQLObject_list_ptr tmp1 = ListTran::tran_class<SQLColumnDefinition, SQLObject>(columns);
    acceptChild(visitor, tmp1);
  }
  visitor->endVisit(SharedObject(SQLAlterTableReplaceColumn));
}

SQLColumnDefinition_list_ptr SQLAlterTableReplaceColumn::getColumns()
{
  return columns;
}

void SQLAlterTableReplaceColumn::addColumn(SQLColumnDefinition_ptr column)
{
  if (column != nullptr)
  {
    column->setParent(SharedObject(SQLAlterTableReplaceColumn));
  }
  this->columns->push_back(column);
}

SQLName_ptr SQLAlterTableReplaceColumn::getFirstColumn()
{
  return firstColumn;
}

void SQLAlterTableReplaceColumn::setFirstColumn(SQLName_ptr first)
{
  this->firstColumn = first;
}

BOOL_ptr SQLAlterTableReplaceColumn::isFirst()
{
  return first;
}

void SQLAlterTableReplaceColumn::setFirst(BOOL_ptr first)
{
  this->first = first;
}

SQLName_ptr SQLAlterTableReplaceColumn::getAfterColumn()
{
  return afterColumn;
}

void SQLAlterTableReplaceColumn::setAfterColumn(SQLName_ptr after)
{
  this->afterColumn = after;
}
